

<template>
  <view v-if="countDownList && countDownList[0]" class="Mall4j">
    <view v-if="!commentShow" class="container">
      <!-- 秒杀商品详情 -->
      <view class="top-goods-box">
        <!-- 商品图片 -->
        <view class="goods-img">
          <image :src="seckilldet.pic" />
        </view>
        <!-- 倒计时栏 -->
        <view class="countdown-box">
          <!-- 秒杀 -->
          <text class="second-kill">{{ i18n.spike }}</text>
          <view class="countdown-content">
            <!-- 秒杀未开始 -->
            <view v-if="countDownList[0].type===0">
              <text class="countdown-tips">{{ i18n.onlyStart }}</text>
              <text class="countdown-time"><text class="countdown-tips">{{ countDownList[0].day }}</text>{{ countDownList[0].hou }}{{ countDownList[0].min }}{{ countDownList[0].sec }}</text>
            </view>
            <!-- 秒杀在进行 -->
            <view v-if="countDownList[0].type===1">
              <text class="countdown-tips">{{ i18n.onlyEnd }}</text>
              <text class="countdown-time"><text class="countdown-tips">{{ countDownList[0].day }}</text>{{ countDownList[0].hou }}{{ countDownList[0].min }}{{ countDownList[0].sec }}</text>
            </view>
            <!-- 秒杀已结束 -->
            <view v-if="countDownList[0].type===2">
              <text class="countdown-tips">{{ i18n.secondKillOver }}</text>
              <text class="countdown-time"><text class="countdown-tips">{{ countDownList[0].day }}</text>{{ countDownList[0].hou }}{{ countDownList[0].min }}{{ countDownList[0].sec }}</text>
            </view>
          </view>
        </view>
        <!-- 商品信息 -->
        <view v-if="defaultSku" class="goods-msg">
          <!-- 标题 -->
          <view class="goods-title">{{ seckilldet.prodName }}</view>
          <!-- 价格 -->
          <!-- 秒杀开始前 -->
          <view class="goods-price">
            <text class="current-price">
              <text class="sub">￥</text>{{ wxs.toPrice(defaultSku.seckillPrice) }}
            </text>
            <text class="original-price">￥{{ wxs.toPrice(defaultSku.price) }}</text>
            <!-- <text class="original-price">￥{{ wxs.toPrice(originalPrice) }}</text> -->
          </view>
          <!-- 运费 -->
          <view class="other-infor clearfix">
            <text class="inventory">{{ i18n.inventory }}：{{ defaultSku.seckillStocks }}</text>
            <text v-if="maxNum > 0" class="inventory">{{ i18n.purchaseLimit }}：{{ maxNum }}</text>
          </view>
          <!-- 悬浮按钮 -->
          <view :class="'suspension-box ' + (showBacktop?'scroll-top':'')">
            <!-- 分享 -->
            <!-- <button class="suspension-btn btn-type" open-type="share">
							<image src="https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/share-prod.png"></image>
						</button> -->

            <!-- 回到顶部 -->
            <view v-if="showBacktop" class="suspension-btn" @tap="backToTop">
              <image src="https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/back-to-top.png" />
            </view>
          </view>
          <!-- /悬浮按钮 -->
        </view>
      </view>
      <!-- 已选规格 -->
      <prod-sku-select v-if="loaded" :pic="pic" :sku-list="skuList" :default-price="seckillPrice" :prod-type="2" :prod-num="prodNum" :has-max-num="seckilldet.seckill.maxNum > -1" :max-num="maxNum" :page-type="countDownList[0] ? countDownList[0].type + 1 : null" :seckill-type="countDownList[0] ? countDownList[0].type : null" :is-cpic-url="true" :sku-show="!hideModal" @buyNow="seckillconfirm" @setSku="setSku" @showSku="showModal" @closeSkuPop="hideModalFun" @setVirtualInputInfo="setVirtualInputInfo" @setProdNum="setProdNum" />

      <!-- 评价 -->
      <view class="cmt-wrap box-radius">
        <view class="cmt-tit" @tap="showComment(-1)">
          <view class="cmt-t">{{ i18n.evaluation }}<text class="cmt-good">{{ i18n.praise + ' ' }}{{ prodCommData.positiveRating }}%</text>
          </view>
          <view class="cmt-count">{{ i18n.inTotal }} {{ prodCommData.number }} {{ i18n.itemTiao }}<text class="arrow" />
          </view>
        </view>
        <view class="cmt-cont">
          <view class="cmt-tag">
            <text @tap="showComment(-1)">{{ i18n.all + ' ' }}({{ prodCommData.number }})</text>
            <text @tap="showComment(0)">{{ i18n.praise + ' ' }}({{ prodCommData.praiseNumber }})</text>
            <text @tap="showComment(1)">{{ i18n.mediumEvaluation + ' ' }}({{ prodCommData.secondaryNumber }})</text>
            <text @tap="showComment(2)">{{ i18n.badEvaluation + ' ' }}({{ prodCommData.negativeNumber }})</text>
            <text class="last-text" @tap="showComment(3)">{{ i18n.havePictures + ' ' }}({{ prodCommData.picNumber }})</text>
          </view>
          <view class="cmt-items">
            <view v-for="(item, prodCommId) in littleCommPage" :key="prodCommId" class="cmt-item">
              <view class="cmt-user">
                <text class="date">{{ item.recTime }}</text>
                <view class="cmt-user-info">
                  <image class="user-img" :src="item.pic?item.pic:'https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/head04.png'" />
                  <view class="nickname">
                    <view class="name-star">
                      <view class="name">{{ item.isAnonymous==1?i18n.anonymousEvaluation:item.nickName }}</view>
                      <comm-star :value="item.score" />
                    </view>
                    <view style="color: #999;">{{ item.skuName || '' }}</view>
                  </view>

                </view>
              </view>
              <view class="cmt-cnt">
                <text decode="true">{{ item.content }}</text>
              </view>
              <scroll-view v-if="item.pics && item.pics.length" class="cmt-attr" scroll-x="true">
                <image v-for="(commPic, index) in item.pics" :key="index" mode="aspectFit" :src="commPic" :data-pics="item.pics" :data-src="commPic" @tap="clickImg" />
              </scroll-view>
            </view>
          </view>
          <view v-if="showBtnAll" class="cmt-more-v">
            <text @tap="showComment(-1)">{{ i18n.viewAllEvaluation }}</text>
          </view>
        </view>
      </view>
      <!-- 评价 end -->

      <!-- 商品详情 -->
      <view class="prod-detail">
        <rich-text :nodes="content" />
      </view>

      <!-- 底部按钮 -->
      <view :class="'cart-footer'">
        <view class="btn icon" @tap="toHomePage">
          <image src="https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/tabbar/homepage.png" />{{ i18n.homepage }}
        </view>
        <view class="btn icon" @tap="handleCustomService">
          <image src="https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/shop-customer-service.png" />{{ i18n.customerService }}
        </view>

        <!-- <view class="btn pre-sale-buy cart-radius" @tap="buyNow" v-if="preSellStatus == 1">{{i18n.buyNow}}</view> -->
        <view v-if="countDownList[0].type===1" class="btn buy cart-radius" @tap="showModal">
          {{ i18n.immediatelyBuy }}
        </view>
        <view v-if="countDownList[0].type===0" class="btn pre-sale-buy cart-radius" @tap="toProdDetailsPage">
          {{ i18n.retailPricePurchase }}
        </view>
      </view>
      <!-- 底部按钮 end -->
    </view>
    <!-- 评价弹窗 -->
    <view v-if="commentShow" :class="prodCommData.number?'cmt-popup':'cmt-no-popup'">
      <view class="cmt-tit">
        <view class="cmt-t">{{ i18n.productEvaluation }}<text class="cmt-good">{{ i18n.rating + ' ' }}{{ prodCommData.positiveRating }}%</text>
        </view>
        <view class="close" @tap="closePopup" />
      </view>
      <scroll-view scroll-y="true" class="cmt-cont">
        <view class="cmt-tag">
          <text data-evaluate="-1" :class="evaluate==-1?'selected':''" @tap="getProdCommPage">{{ i18n.all + ' ' }}({{ prodCommData.number }})</text>
          <text data-evaluate="0" :class="evaluate==0?'selected':''" @tap="getProdCommPage">{{ i18n.praise + ' ' }}({{ prodCommData.praiseNumber }})</text>
          <text data-evaluate="1" :class="evaluate==1?'selected':''" @tap="getProdCommPage">{{ i18n.mediumEvaluation + ' ' }}({{ prodCommData.secondaryNumber }})</text>
          <text data-evaluate="2" :class="evaluate==2?'selected':''" @tap="getProdCommPage">{{ i18n.badEvaluation + ' ' }}({{ prodCommData.negativeNumber }})</text>
          <text data-evaluate="3" :class="evaluate==3?'selected':''" @tap="getProdCommPage">{{ i18n.havePictures + ' ' }}({{ prodCommData.picNumber }})</text>
        </view>
        <view class="cmt-items">
          <view v-for="(item, prodCommId) in prodCommPage.records" :key="prodCommId" class="cmt-item">
            <view class="cmt-user">
              <text class="date">{{ item.recTime }}</text>
              <view class="cmt-user-info">
                <image class="user-img" :src="item.pic?item.pic:'https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/head04.png'" />
                <view class="nickname">
                  <view class="name-star">
                    <view class="name">{{ item.isAnonymous==1?i18n.anonymousEvaluation:item.nickName }}</view>
                    <comm-star :value="item.score" />
                  </view>
                  <view style="color: #999;">{{ item.skuName || '' }}</view>
                </view>
              </view>
            </view>
            <view class="cmt-cnt">
              <text decode="true">{{ item.content }}</text>
            </view>
            <scroll-view v-if="item.pics && item.pics.length" class="cmt-attr" scroll-x="true">
              <image v-for="(commPic, index) in item.pics" :key="index" :src="commPic" :data-pics="item.pics" :data-src="commPic" @tap="clickImg" />
            </scroll-view>
            <view v-if="item.replyContent" class="cmt-reply">
              <text class="reply-tit">{{ i18n.shopReply }}：</text><text class="reply-content">{{ item.replyContent }}</text>
            </view>
          </view>
        </view>
        <!-- 列表空 -->
        <view v-if="!prodCommPage.records.length" class="empty">
          <view class="empty-icon">
            <image src="https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/empty-com.png" />
          </view>
          <view class="empty-text">{{ i18n.noProductReviewsTips }}</view>
        </view>
        <!-- /列表空 -->
        <view v-if="prodCommPage.pages > prodCommPage.current" class="load-more">
          <text @tap="getMoreCommPage">{{ i18n.clickLoadMore }}</text>
        </view>
      </scroll-view>
    </view>
    <!-- 评价弹窗 end -->
  </view>

</template>

<script module="wxs" lang="wxs" src="../../../wxs/number.wxs"></script>

<script>
// pages/snap-up-detail/snap-up-detail.js
var http = require("../../../utils/http.js");
var util = require("../../../utils/util.js");
import prodSkuSelect from '@/components/prod-sku-select/index.vue';

export default {
  data () {
    return {
      hideModal: true,
      seckillId: 0,
      seckilldet: {},
      countdown: "",
      // 秒杀倒计时
      countDownListTimeout: null,
      countdownlist: [],
      // 秒杀倒计时列表
      originalPrice: 0,
      skuList: [],
      defaultSku: undefined,
      seckillPrice: 0,
      prodNum: 1,
      maxNum: 1,
      evaluate: -1,
      prodCommData: {},
      showBtnAll: false,
      commentShow: false,
      prodCommPage: {
        current: 0,
        pages: 0,
        records: []
      },
      orderPath: '',
      //秒杀活动剩余总库存
      seckillTotalStocks: 1,
      findSku: true,
      littleCommPage: [],
      isAuthInfo: true,
      showBacktop: false, //回到顶部显隐
      countDownList: "",
      animationData: "",
      content: '',
      scrollTop: -1,
      pic: "",
      prodId: '', //产品id
      loaded: false
    };
  },

  components: {
    prodSkuSelect
  },
  props: {},

  computed: {
    i18n () {
      return this.$t('index')
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const {
      seckillId
    } = options;
    this.setData({
      seckillId: seckillId
    });
    this.getskdet(true);
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () { },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    //头部导航标题
    uni.setNavigationBarTitle({
      title: this.i18n.secondsKillProductDetails
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () { },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    clearTimeout(this.countDownListTimeout);
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () { },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () { },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () { },
  methods: {
    /**
     * 修改商品sku
     */
    setSku (sku, findSku) {
      this.findSku = findSku
      this.defaultSku = sku
    },

    /**
     * 修改商品数量
     */
    setProdNum (prodNum) {
      this.prodNum = prodNum
    },

    /**
     * 输入商品数量
     */
    prodNumInp (e) {
      let num = Number(e.detail.value.replace(/[^\d]/g, ''))
      this.prodNum = num
    },

    /**
     * 咨询客服
     */
    handleCustomService () {
      util.checkAuthInfo(() => {
        uni.navigateTo({
          url: '/pages/chat/chat?shopid=' + 0 + '&prodid=' + this.prodId
        });
      })
    },
    // 获取秒杀商品详情
    getskdet (isFirst) {
      const {
        seckillId
      } = this; // 请求详情数据
      http.request({
        url: "/seckill/prod?seckillId=" + seckillId,
        method: "GET",
        callBack: res => {
          if (res) {
            let endTimeList = [];
            var objs = {};
            objs.eTime = res.seckill.endTime;
            objs.sTime = res.seckill.startTime;
            objs.countType = null; //1表示秒杀活动正在进行,0表示秒杀活动未开始
            endTimeList.push(objs);

            this.setData({
              seckillTotalStocks: res.seckill.seckillTotalStocks,
              seckilldet: res,
              countdownlist: endTimeList,
              skuList: res.skuList,
              seckillPrice: res.seckill.seckillPrice,
              maxNum: res.seckill.maxNum,
              originalPrice: res.price,
              content: util.formatHtml(res.content),
              prodId: res.prodId,
              pic: res.pic,
              loaded: true
            });
            this.countdownFun();
            if (uni.getStorageSync('token')) {
              this.prodBrowseLog(res.prodId)
            }
          } else {
            uni.showToast({
              title: this.i18n.secondKillOver,
              duration: 2000,
              icon: 'none',
              complete: res => {
                setTimeout(() => {
                  const pages = getCurrentPages()
                  if (pages.length >= 2) {
                    uni.navigateBack({
                      delta: 1
                    })
                  } else {
                    uni.reLaunch({
                      url: '/pages/index/index'
                    })
                  }
                }, 2000)
              }
            })
          }
          // 加载评论数据
          this.getProdCommData();
        }
      });
    },

    // 保存浏览记录
    prodBrowseLog (prodId) {
      http.request({
        url: "/p/prodBrowseLog",
        method: "POST",
        data: {
          prodId
        },
        callBack: res => {
        }
      });
    },

    // 倒计时
    countdownFun () {
      let isEnd = false
      // 获取当前时间，同时得到活动结束时间数组
      let newTime = new Date().getTime();
      let endTimeList = this.countdownlist;
      let countDownArr = []; // 对结束时间进行处理渲染到页面

      endTimeList.forEach(o => {
        if (newTime - util.dateToTimestamp(o.sTime) > 0) {
          let endTime = util.dateToTimestamp(o.eTime);
          let obj = null; // 如果活动未结束，对时间进行处理

          if (endTime - newTime > 0) {
            let time = (endTime - newTime) / 1000; // 获取天、时、分、秒

            let day = parseInt(time / (60 * 60 * 24));
            let hou = parseInt(time % (60 * 60 * 24) / 3600);
            let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
            let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
            obj = {
              day: this.timeFormat(day) + this.i18n.day,
              hou: this.timeFormat(hou) + ':',
              min: this.timeFormat(min) + ':',
              sec: this.timeFormat(sec),
              type: 1 // 表示秒杀正在进行

            };
          } // 活动已结束
          else {
            obj = {
              day: '00',
              hou: '00',
              min: '00',
              sec: '00',
              type: 2 // 表示秒杀已结束
            };
            isEnd = true
          }

          countDownArr.push(obj);
        } // 活动未开始
        else {
          let startTime = util.dateToTimestamp(o.sTime);
          let time = (startTime - newTime) / 1000;
          let obj = null; // 获取天、时、分、秒

          let day = parseInt(time / (60 * 60 * 24));
          let hou = parseInt(time % (60 * 60 * 24) / 3600);
          let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
          let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
          obj = {
            day: this.timeFormat(day) + this.i18n.day,
            hou: this.timeFormat(hou) + ':',
            min: this.timeFormat(min) + ':',
            sec: this.timeFormat(sec),
            type: 0 // 表示秒杀还没开始

          };
          countDownArr.push(obj);
        }
      });
      if (isEnd) {
        clearTimeout(this.countDownListTimer)
        uni.redirectTo({
          url: '/package-activities/pages/snap-up-list/snap-up-list'
        })
        return
      }

      // 渲染，然后每隔一秒执行一次倒计时函数
      this.setData({
        countDownList: countDownArr,
        countDownListTimeout: setTimeout(this.countdownFun, 1000)
      });
    },

    // 小于10的格式化函数
    timeFormat (times) {
      return times < 10 ? '0' + times : times;
    },

    getProdCommData () {
      http.request({
        url: "/prod/prodCommData",
        method: "GET",
        data: {
          prodId: this.prodId
        },
        callBack: res => {

          this.setData({
            prodCommData: res,
            showBtnAll: res.number > 2 ? true : false
          });
        }
      });
    },

    // 获取部分评论
    getLittleProdComm () {
      if (this.prodCommPage.records.length) {
        return;
      }

      this.getProdCommPage();
    },

    closePopup: function () {
      util.tapLog(3)
      this.setData({
        commentShow: false
      });
    },

    getMoreCommPage (e) {
      this.getProdCommPage();
    },

    // 获取分页获取评论
    getProdCommPage (e) {
      util.tapLog(3)
      if (e) {
        if (e.currentTarget.dataset.evaluate === this.evaluate) {
          return;
        }

        this.setData({
          prodCommPage: {
            current: 0,
            pages: 0,
            records: []
          },
          evaluate: e.currentTarget.dataset.evaluate
        });
      }

      http.request({
        url: "/prod/prodCommPageByProd",
        method: "GET",
        data: {
          prodId: this.prodId,
          size: 10,
          current: this.prodCommPage.current + 1,
          evaluate: this.evaluate
        },
        callBack: res => {
          res.records.forEach(item => {
            if (item.pics) {
              item.pics = item.pics.split(',');
            }
          });
          let records = this.prodCommPage.records;
          records = records.concat(res.records);
          this.setData({
            prodCommPage: {
              current: res.current,
              pages: res.pages,
              records: records
            }
          }); // 如果商品详情中没有评论的数据，截取两条到商品详情页商品详情

          if (!this.littleCommPage.length) {
            this.setData({
              littleCommPage: records.slice(0, 2)
            });
          }
        }
      });
    },

    // 显示评论页面
    showComment: function (e) {
      util.tapLog(3)
      if (this.isPlaying) {
        this.stopPlay()
      }
      this.setData({
        commentShow: true,
        evaluate: e,
        prodCommPage: {
          current: 0,
          pages: 0,
          records: []
        },
      });
      this.getProdCommPage();
    },

    /**
     * 评论小图点击事件(点击图片显示大图)
     */
    clickImg: function (e) {
      const current = e.currentTarget.dataset.src //获取当前点击的 图片 url
      var pics = e.currentTarget.dataset.pics
      uni.previewImage({
        current: current,
        urls: pics
      })
    },

    /**
     * 回到顶部
     */
    backToTop: function () {
      util.tapLog(3)
      uni.pageScrollTo({
        scrollTop: 0,
        duration: 400
      })
    },

    /**
     * 监听页面滚动
     */
    onPageScroll: function (e) {
      this.scrollTop = e.scrollTop
      if (e.scrollTop > 600) {
        this.setData({
          showBacktop: true
        });
      } else if (e.scrollTop < 600) {
        this.setData({
          showBacktop: false
        });
      }
    },

    // 确认秒杀商品
    seckillconfirm () {
      if (this.countDownList[0].type === 0) {
        return this.toProdDetailsPage()
      }
      if (!this.findSku) {
        return;
      }
      if (this.prodNum < 1 || !this.prodNum) {
        uni.showToast({
          title: this.i18n.leastTips,
          icon: 'none',
          duration: 2000
        });
        return;
      }
      if (this.maxNum != -1 && this.prodNum > this.maxNum) {
        uni.showToast({
          title: this.i18n.purchaseLimit + this.maxNum + this.i18n.piece,
          icon: 'none',
          duration: 1000,
          mask: true
        });
        return
      }
      if (!this.defaultSku.seckillStocks || this.defaultSku.seckillStocks < this.prodNum) {
        uni.showToast({
          title: this.i18n.insufficientStock,
          icon: 'none',
          duration: 1000,
          mask: true
        });
        return
      }
      var secKillObj = {};
      secKillObj.addrId = 0;
      secKillObj.prodCount = this.prodNum;
      secKillObj.seckillSkuId = this.defaultSku.seckillSkuId;
      wx.setStorageSync("secKillObj", secKillObj);
      this.setData({
        hideModal: true
      })
      util.tapLog(3)
      uni.navigateTo({
        url: '/package-activities/pages/confirm-order/confirm-order'
      });
    },

    //  零售价购买
    toProdDetailsPage: function (e) {
      util.tapLog(3)
      this.$Router.push({ path: '/pages/prod/prod', query: { prodid: this.seckilldet.prodId } })
    },

    /**
     * 显示遮罩层
     */
    showModal: function () {
      util.tapLog(3)
      var that = this; // 检查是否授权

      util.checkAuthInfo(() => {
        // 已经授权，可以直接调用 getUserInfo 获取头像昵称
        that.setData({
          isAuthInfo: true,
          hideModal: false
        });
        var animation = wx.createAnimation({
          duration: 600,
          //动画的持续时间 默认400ms 数值越大，动画越慢 数值越小，动画越快
          timingFunction: 'ease' //动画的效果 默认值是linear

        });
        that.animation = animation;
        setTimeout(function () {
          that.fadeIn(); //调用显示动画
        }, 100);
      });
    },

    /**
     * 获取用户信息
     */
    onGotUserInfo: function (e) {
      if (e.detail.errMsg != "getUserInfo:fail auth deny") {
        this.setData({
          isAuthInfo: true
        });
        http.updateUserInfo();
      }
    },

    /**
     * 隐藏遮罩层
     */
    hideModalFun: function () {
      util.tapLog(3)
      var that = this;
      var animation = wx.createAnimation({
        duration: 800,
        //动画的持续时间 默认400ms 数值越大，动画越慢 数值越小，动画越快
        timingFunction: 'ease' //动画的效果 默认值是linear

      });
      this.animation = animation;
      that.fadeDown(); //调用隐藏动画

      setTimeout(function () {
        that.setData({
          hideModal: true
        });
      }, 720); //先执行下滑动画，再隐藏模块
    },

    /**
     * 动画集
     */
    fadeIn: function () {
      this.animation.translateY(0).step();
      this.setData({
        animationData: this.animation.export() //动画实例的export方法导出动画数据传递给组件的animation属性

      });
    },
    fadeDown: function () {
      this.animation.translateY(300).step();
      this.setData({
        animationData: this.animation.export()
      });
    },

    /**
     * 跳转到首页
     */
    toHomePage: function () {
      util.tapLog(3)
      this.$Router.pushTab('/pages/index/index')
    },

    /**
     * 跳转到购物车
     */
    toCartPage: function () {
      util.tapLog(3)
      this.$Router.pushTab('/pages/basket/basket')
    }
  }
};
</script>
<style>
@import "./snap-up-detail.css";
</style>
